FROM python:3.9.16-slim

WORKDIR /src

ARG TAG_BASED_SELECTION
ENV TAG_BASED_SELECTION ${TAG_BASED_SELECTION}
ARG PRIORITIZE_WITH_SAME_TOPIC_ENTITY
ENV PRIORITIZE_WITH_SAME_TOPIC_ENTITY ${PRIORITIZE_WITH_SAME_TOPIC_ENTITY}
ARG PRIORITIZE_NO_DIALOG_BREAKDOWN
ENV PRIORITIZE_NO_DIALOG_BREAKDOWN ${PRIORITIZE_NO_DIALOG_BREAKDOWN}
ARG PRIORITIZE_WITH_REQUIRED_ACT
ENV PRIORITIZE_WITH_REQUIRED_ACT ${PRIORITIZE_WITH_REQUIRED_ACT}
ARG IGNORE_DISLIKED_SKILLS
ENV IGNORE_DISLIKED_SKILLS ${IGNORE_DISLIKED_SKILLS}
ARG GREETING_FIRST
ENV GREETING_FIRST ${GREETING_FIRST}
ARG RESTRICTION_FOR_SENSITIVE_CASE
ENV RESTRICTION_FOR_SENSITIVE_CASE ${RESTRICTION_FOR_SENSITIVE_CASE}
ARG PRIORITIZE_PROMTS_WHEN_NO_SCRIPTS
ENV PRIORITIZE_PROMTS_WHEN_NO_SCRIPTS ${PRIORITIZE_PROMTS_WHEN_NO_SCRIPTS}
ARG PRIORITIZE_HUMAN_INITIATIVE
ENV PRIORITIZE_HUMAN_INITIATIVE ${PRIORITIZE_HUMAN_INITIATIVE}
ARG MAX_TURNS_WITHOUT_SCRIPTS
ENV MAX_TURNS_WITHOUT_SCRIPTS ${MAX_TURNS_WITHOUT_SCRIPTS}
ARG ADD_ACKNOWLEDGMENTS_IF_POSSIBLE
ENV ADD_ACKNOWLEDGMENTS_IF_POSSIBLE ${ADD_ACKNOWLEDGMENTS_IF_POSSIBLE}
ARG PROMPT_PROBA
ENV PROMPT_PROBA ${PROMPT_PROBA}
ARG ACKNOWLEDGEMENT_PROBA
ENV ACKNOWLEDGEMENT_PROBA ${ACKNOWLEDGEMENT_PROBA}
ARG CALL_BY_NAME_PROBABILITY
ENV CALL_BY_NAME_PROBABILITY ${CALL_BY_NAME_PROBABILITY}
ARG PRIORITIZE_SCRIPTED_SKILLS
ENV PRIORITIZE_SCRIPTED_SKILLS ${PRIORITIZE_SCRIPTED_SKILLS}
ARG CONFIDENCE_STRENGTH
ENV CONFIDENCE_STRENGTH ${CONFIDENCE_STRENGTH}
ARG CONV_EVAL_STRENGTH
ENV CONV_EVAL_STRENGTH ${CONV_EVAL_STRENGTH}
ARG QUESTION_TO_QUESTION_DOWNSCORE_COEF
ENV QUESTION_TO_QUESTION_DOWNSCORE_COEF ${QUESTION_TO_QUESTION_DOWNSCORE_COEF}
ARG FALLBACK_FILE
ENV FALLBACK_FILE ${FALLBACK_FILE}


COPY ./response_selectors/convers_evaluation_based_selector/requirements.txt requirements.txt
RUN pip install -r requirements.txt && \
    python -c "import nltk; nltk.download('punkt')"

ARG LANGUAGE=EN
ENV LANGUAGE ${LANGUAGE}

COPY ./response_selectors/convers_evaluation_based_selector/ ./
COPY ./common/ ./common/

CMD gunicorn --workers=2 server:app
